# Makefile DMC Win.

CC=dmc
LINK=link
LIBR=lib

# -DNATIVE_WINDOWS 
CFLGS =-o -I. -DMSDMC -DCARES_STATICLIB -DCARES_SYMBOL_HIDING -DHAVE_AF_INET6=0 -DHAVE_WINSOCK2_H -DWIN32

LIB_OBJS	= $(patsubst %.c, %.obj, $(wildcard *.c))
TEST_EXECS	= $(patsubst %.c, %.exe, $(wildcard test/*.c))

ALL: cares.lib

test: $(TEST_EXECS)

%.obj: %.c
	$(CC) $(CFLGS) $^ -c -o$@

%.exe: %.c
	$(CC) $(CFLGS) $^ -L/+wsock32.lib+Advapi32.lib+cares.lib
#link $^,$@,,advapi32+ws2_32+user32+shell32+kernel32+cares/noi/delexe;
	
cares.lib: $(LIB_OBJS)
	echo $(LIB_OBJS)
	$(LIBR) -c cares.lib $(LIB_OBJS)

clean:
	del /S /Q *.obj *.map
